var myImage = (function(){

    var imgNode = document.createElement('img');
    document.body.appendChild(imgNode);

    return{
        setSrc:function(src){
            imgNode.src = src;
        }
    }

})()

var proxyImage = (function(){
    var img = new Image;
    img.onload = function(){
        myImage.setSrc(this.src)
    }

    return{
        setSrc:function(src){
            myImage.setSrc('Heart.svg');
            img.src = src;
        }
    }

})()

proxyImage.setSrc('https://www.baidu.com/img/baidu_jgylogo3.gif')